﻿
using System;
using System.Text;
using UnityEngine;

namespace QPEngine
{
    public static class PathHelp
    {     

        /// <summary>
        ///应用程序外部资源路径存放路径(热更新资源路径)
        /// </summary>
        public static string AppHotfixResPath
        {
            get
            {
                string path = AppResPath;

                if (Application.isMobilePlatform)
                {
                    path = Application.persistentDataPath + "/" + Application.productName + "/";
                }
                else
                {
                    path = $"c:/{Application.productName}/";
                }
                return path;
            }

        }

        /// <summary>
        /// 应用程序内部资源路径存放路径
        /// </summary>
        public static string AppResPath
        {
            get
            {
                string path = string.Empty;
                switch (Application.platform)
                {
                    case RuntimePlatform.Android:
                        path = "jar:file://" + Application.dataPath + "!/assets/";
                        break;
                    default:
                        path = Application.streamingAssetsPath + "/";
                        break;
                }
                return path;
            }
        }
    }
}
